<template>
  <div class="feedback">
    <div class="feedtop">
      <h1>请选择你的反馈问题类型</h1>
      <van-radio-group v-model="radio">
        <van-radio name="1">
          <span class="radiostyle">提现问题</span>
        </van-radio>
        <van-radio name="2">
          <span class="radiostyle">功能异常</span>
        </van-radio>
        <van-radio name="3">
          <span class="radiostyle">账户存在异常</span>
        </van-radio>
      </van-radio-group>
      <div class="content">
        <textarea rows="8" v-model="sstext" class="iptstyle" placeholder="请详细描述你的问题..."></textarea>
      </div>
      <div class="submit" @click="onSubmit">提 交</div>
    </div>
  </div>
</template>
<script>
import { create_customer } from '../api/api';
// import aestool from '@/utils/aestool.js';
export default {
  data(){
    return{
      radio:'1',
      sstext:'',
    }
  },
  methods:{
    onSubmit(){
      if(this.sstext == ''){
        this.$toast('请详细描述您的问题!')
      }else{
        let toastload = this.$toast.loading({
          message: '加载中...',
          forbidClick: true
        });
        let typetext = this.radio == '1' ? '提现问题' : this.radio == '2' ? '功能异常' : this.radio == '3' ? '账户存在异常' : ''
        let params = {
          top:typetext,
          conter:this.sstext,
        }
        create_customer(params).then(res=>{
          toastload.clear()
          console.log('提交',res)
          if(res.Status == 200){
            this.$toast(res.Message)
            this.radio = '1'
            this.sstext = ''
          }else{
            this.$toast(res.Message)
          }
        })
      }
    }
  }
}
</script>
<style lang="stylus" scoped>
.feedback{
  // height 100%
  overflow hidden
  .feedtop{
    padding 10px
    background #fff
    h1{
      padding-left 10px
      border-left 3px solid #333
      font-size 18px
    }
    .radiostyle{
      font-size 16px
      line-height 40px
      margin-left 6px
    }
    .content{
      padding 10px 0
      background #fff
      .iptstyle{
        border 0
        background #f7f8fa
        border-radius 6px
        padding 10px
        width 94%
        font-size 14px
      }
      textarea::-webkit-input-placeholder{
        color #9f9fa1
        font-size 14px
      }
    }
    .submit{
      background #6ba9ff
      margin 10px
      font-size 14px
      color #ffffff
      text-align center
      line-height 40px
      border-radius 20px
    }
  }
}
</style>

